﻿namespace ServBus.ListForm2013.Utility
{
    class BaseTypeStrings
    {
        public const string DropdownDataSouceName = "OptionDataSourceConnection";

        //<xsd:element name="field1" type="xsd:string"/>
        public const string singleText = "<xsd:element name=\"{0}\" ma:displayName=\"{1}\" type=\"xsd:string\" nillable=\"true\" xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\" />";

        public const string number = "<xsd:element name=\"{0}\" ma:displayName=\"{1}\" type=\"xsd:double\" nillable=\"true\" xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\" />";

        public const string dateonly = "<xsd:element name=\"{0}\" ma:displayName=\"{1}\" type=\"xsd:date\" nillable=\"true\" "
        + " xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\"/>";

        public const string datetime = "<xsd:element name=\"{0}\" ma:displayName=\"{1}\" type=\"xsd:dateTime\" nillable=\"true\" "
        + " xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\"/>";

        public const string currency = "<xsd:element name=\"{0}\" ma:displayName=\"{1}\" type=\"xsd:decimal\" nillable=\"true\" xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\" />";


        public const string boolean = "<xsd:element name=\"{0}\" ma:displayName=\"{1}\"  type=\"xsd:boolean\" nillable=\"true\" xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\" />";

        public const string userType = "<xsd:element name=\"{0}\" ma:displayName=\"{1}\" nillable=\"false\" xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\">"
                                            + "<xsd:complexType>"
                                                + "<xsd:sequence>"
                                                    + "<xsd:element ref=\"pc:Person\" minOccurs=\"0\" maxOccurs=\"unbounded\" xmlns:pc=\"http://schemas.microsoft.com/office/infopath/2007/PartnerControls\"/>"
                                                + "</xsd:sequence>"
                                            + "</xsd:complexType>"
                                    + "</xsd:element>";

        public const string url = "<xsd:attribute name=\"{0}_Description\" type=\"xsd:string\"/>"
                                + "<xsd:element name=\"{0}\" ma:displayName=\"{1}\" nillable=\"false\" xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\">"
                                    + "<xsd:complexType>"
                                        + "<xsd:simpleContent>"
                                            + "<xsd:extension base=\"xsd:anyURI\">"
                                                + "<xsd:attribute ref=\"my:{0}_Description\"/>"
                                            + "</xsd:extension>"
                                        + "</xsd:simpleContent>"
                                    + "</xsd:complexType>"
                                + "</xsd:element>";

        public const string multiText = "<xsd:element name=\"{0}\" ma:displayName=\"{1}\" ma:allowDeletion=\"false\" xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\">"
                                            + "<xsd:complexType mixed=\"true\">"
                                                + "<xsd:sequence>"
                                                    + "<xsd:any minOccurs=\"0\" maxOccurs=\"unbounded\" namespace=\"http://www.w3.org/1999/xhtml\" processContents=\"lax\"/>"
                                                + "</xsd:sequence>"
                                            + "</xsd:complexType>"
                                        + "</xsd:element>";

        public const string MultiDropdownToSchema1 = "<xsd:element xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"  xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\" name=\"{0}\" ma:displayName=\"{1}\" nillable=\"false\">"
                                                    + "<xsd:complexType><xsd:sequence>"
                                                        + "<xsd:element ref=\"my:{0}_1\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>"
                                                    + "</xsd:sequence></xsd:complexType></xsd:element>"
                                                    + "<xsd:element xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" nillable=\"false\" name=\"{0}_1\" type=\"xsd:string\"/>";

        public const string lookup = "<xsd:element name=\"{0}\" ma:displayName=\"{1}\" type=\"xsd:positiveInteger\" nillable=\"true\" xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\" />";

        public const string DropdownXsdFile = "<xsd:element {1} name=\"{0}\" minOccurs=\"0\" maxOccurs=\"1\"><xsd:complexType><xsd:sequence><xsd:element name=\"SharePointListChoice_RW\" minOccurs=\"0\" maxOccurs=\"unbounded\">"
        + "<xsd:complexType><xsd:simpleContent><xsd:extension base=\"xsd:string\"><xsd:attribute name=\"DisplayName\" type=\"xsd:string\"/></xsd:extension></xsd:simpleContent></xsd:complexType>"
        + "</xsd:element></xsd:sequence></xsd:complexType></xsd:element>";

        public const string DropdownToSchema = "<xsd:element xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" name=\"{1}\" type=\"xsd:string\" ma:displayName=\"{2}\" ma:readOnly=\"false\" ma:allowDeletion=\"true\" ma:auxDataSourceName=\"{0}\""
            + " ma:auxChoicesXPath=\"/root/{1}/SharePointListChoice_RW\" ma:auxValue=\".\" ma:auxDisplay=\"@DisplayName\" xmlns:ma=\"http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes\"/>";

        public const string ChoiceXsdRefInManifest = "<xsf:file name=\"choices.xsd\">"
                + "<xsf:fileProperties>"
                    + "<xsf:property name=\"dataObject\" type=\"string\" value=\"{0}\"></xsf:property>"
                    + "<xsf:property name=\"rootElement\" type=\"string\" value=\"root\"></xsf:property>"
                    + "<xsf:property name=\"useOnDemandAlgorithm\" type=\"string\" value=\"yes\"></xsf:property>"
                + "</xsf:fileProperties>"
            + "</xsf:file>";

        public const string ChoiceXmlRefInManifest = "<xsf:file name=\"choices.xml\">"
                + "<xsf:fileProperties>"
                    + "<xsf:property name=\"fileType\" type=\"string\" value=\"resource\"></xsf:property>"
                + "</xsf:fileProperties>"
            + "</xsf:file>";

        public const string DropDownConnectionInSampleData = "<xd:DataConnection  Name=\"{0}\">"
        + "<root><{1}><SharePointListChoice_RW/></{1}>"
        + "<xd:SchemaInfo LocalName=\"root\" NamespaceURI=\"\"><xd:Namespaces><xd:Namespace LocalName=\"root\" NamespaceURI=\"\"/>"
        + "</xd:Namespaces></xd:SchemaInfo></root></xd:DataConnection>";

        public const string DropdownOneNode = "<{0}><SharePointListChoice_RW/></{0}>";

        public const string DropdownDataObjectInManifest = "<xsf:dataObject name=\"{0}\" {2} schema=\"choices.xsd\" initOnLoad=\"yes\">"
            + "<xsf:query>"
                + "<xsf:xmlFileAdapter fileUrl=\"x-soln:///choices.xml\" name=\"{1}\"></xsf:xmlFileAdapter>"
            + "</xsf:query>"
        + "</xsf:dataObject>";
    }
}
